package com.mike.employment.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mike.employment.base.ApiResult;
import com.mike.employment.service.AnaylizeService;

@RestController
@RequestMapping("/api/anaylize")
public class AnaylizeController {

	@Autowired
	private AnaylizeService anaylizeService;
	
	@GetMapping("/admin")
	public ApiResult getData() {
		return ApiResult.success(anaylizeService.getAdminData());
	}
	
	@GetMapping("/student/{accountId}")
	public ApiResult getStudentData(@PathVariable("accountId") Long accountId) {
		return ApiResult.success(anaylizeService.getStudentData(accountId));
	}
	
	@GetMapping("/company/{accountId}")
	public ApiResult getComData(@PathVariable("accountId") Long accountId) {
		return ApiResult.success(anaylizeService.getCompanyData(accountId));
	}
	
	@GetMapping("/teacher/{accountId}")
	public ApiResult getTeacherData(@PathVariable("accountId") Long accountId) {
		return ApiResult.success(anaylizeService.getTeacherData(accountId));
	}
}
